import service from "@/utils/service.js";

// 获取楼栋信息
export const getBuild = () => {
	return service({
		method: "GET",
		url: "/api/admin/getBuild",
	});
};
// 获取充值电费信息
export const getDianInfo = () => {
	return service({
		method: "GET",
		url: "/api/admin/getDianInfo",
	});
};
// 删除充电费信息
export const DelDianInfo = (id) => {
	return service({
		method: "DELETE",
		url: "/api/admin/DelDian",
        params:id
	});
};
// 获取公告
export const getTitle = () => {
	return service({
		method: "GET",
		url: "/api/admin/getTitle",
	});
};
//删除公告
export const DelTitle = (id) => {
	// console.log(id)
	return service({
		method: "delete",
		url: "/api/admin/DelTitle",
		params:{...id}
	});
};
// 插入公告
export const InsertTitle = ({...info}) => {
	// console.log(id)
	return service({
		method: "post",
		url: "/api/admin/InsertTitle",
		params:info
	});
};
// 批量删除
export const DelAll = (info) => {
	console.log(...info)
	return service({
		method: "post",
		url: "/api/admin/DelAll",
		params:{Rows:[...info]}
	});
};
// 发布公告
export const Fabu = (id) => {
	console.log(id)
	return service({
		method: "post",
		url: "/api/admin/Fabu",
		params:{id},
	});
};
// 编辑
export const EditTitleInfo = ({...info}) => {
	console.log(info)
	return service({
		method: "post",
		url: "/api/admin/editTitleInfo",
		data:info,
	});
};
// 搜索
export const SelectTitle = (id) => {
	// console.log("33",id)
	return service({
		method: "get",
		url: "/api/admin/SelectTitle",
		params:{id},
	});
};

// 数据报表
export const getDataReport = () => {	
	return service({
		method: "GET",
		url: "/api/admin/getDataReport",
	});
};

// 房间信息
export const getRoomNumber = () => {	
	return service({
		method: "GET",
		url: "/api/admin/getRoomNumber",
	});
};
 
// 水电费用
export const getCost = () => {	
	return service({
		method: "GET",
		url: "/api/admin/getCost",
	});
};
// 编辑公告
export const EdidTitle = (info) => {	
	return service({
		method: "POST",
		url: "/api/admin/editTitleInfo",
		data:{...info}
	});
};
// 搜索学生
export const selectStudent = () => {
	return service({
		method: "GET",
		url: "/api/admin/SelectStudent",
		// data:{...info}
	});
};
// 搜索管理用户
export const selectAdmin = (id) => {
	return service({
		method: "GET",
		url: "/api/admin/selectAdmin",
		params:id,
	});
};
//  修改管理信息
export const updateAdmin = (info) => {
	return service({
		method: "post",
		url: "/api/admin/updateAdmin",
		data:{...info},
	});
};
export const personNums = (id) => {
	return service({
		method: "get",
		url: "/api/student/personNum",
		params:{id:id},
	});
}
// 订单
export const getDelare = (id) => {
	return service({
		method: "get",
		url: "/api/admin/getDelare",
		params:{id:id},
	});
}
// 搜索宿舍人数
// export const personNums = (id) => {
// 	return service({
// 		method: "get",
// 		url: "/api/student/personNum",
// 		params:{id:id},
// 	});
// };
// 获取待处理消息
export const getDaiInfo = (id) => {
	return service({
		method: "get",
		url: "/api/admin/getDaiInfo",
		params:{id:id},
	});
}

// 获取楼层
export const getFloors = (id) => {
	return service({
		method: "get",
		url: "/api/admin/getFloor",
		params:{id:id},
	});
}
//  获取房间
export const getRooms = (id) => {
	return service({
		method: "get",
		url: "/api/admin/getRooms",
		params:{id:id},
	});
}
//添加学生
export const addStudent = (info) => {
	return service({
		method: "post",
		url: "/api/admin/addStudent",
		data:{...info},
	});
}
// 添加学生卡
export const addCard = (id) => {
	return service({
		method: "post",
		url: "/api/admin/addCard",
		data:{id:id},
	});
}
// 删除学生
export const delStudent = (arr) => {
	return service({
		method: "delete",
		url: "/api/admin/delStudent",
		data:arr,
	});
}
// 报修订单
export const getDeclareInfo = (id) => {
	return service({
		method: "get",
		url: "/api/admin/getDeclareInfo",
		params:{id:id}
	});
}
// 更新
export const getDelareUpdate = (id) => {
	return service({
		method: "post",
		url: "/api/admin/getDelareUpdate",
		data:{id:id}
	});
}
// 留言
export const addLiu = (info) => {
	return service({
		method: "post",
		url: "/api/admin/addLiu",
		data:{...info}
	});
}
export const selectLui = () => {
	return service({
		method: "get",
		url: "/api/admin/selectLui",
		// data:{...info}
	});
}
export const updateLiu = (id) => {
	return service({
		method: "post",
		url: "/api/admin/updateLiu",
		data:{id:id}
	});
}
export const getOrderList = () => {
	return service({
		method: "get",
		url: "/api/admin/getOrderList",
		// data:{id:id}
	});
}
export const getDeclareInfoAll = () => {
	return service({
		method: "get",
		url: "/api/admin/getDeclareInfoAll",
		// data:{id:id}
	});
}